import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:get/get.dart';
import 'package:jinke/utils/component/page_state/widgets/empty.dart';
import 'package:jinke/utils/util.dart';

import 'logic.dart';

class Instruction_detailPage extends StatelessWidget {
  final logic = Get.put(Instruction_detailLogic());
  final state = Get.find<Instruction_detailLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: ColorsUtil.blue,
        elevation: 0,
        leading: BackButton(color: Colors.white,),
        title: Text('批示详情',style: TextStyle(color: Colors.white,fontSize: 17.r),),
        centerTitle: true,
      ),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Stack(
            children: [
              Container(
                  height: 100.r,
                  width: 1.sw,
                  color: ColorsUtil.blue,
              ),
              Container(
                decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.circular(4.r),
                  boxShadow: [
                    BoxShadow(
                        offset: const Offset(1, 1),//x,y轴
                        color: const Color(0x1A071428),//投影颜色
                        blurRadius: 2.r//投影距离
                    )
                  ],
                ),
                margin: EdgeInsets.fromLTRB(16.r, 16.r, 16.r, 0),
                child: Padding(
                  padding: EdgeInsets.fromLTRB(16.r, 16.r, 16.r, 0),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text(
                        state.proInstruction.projectAlias??'',
                        style: TextStyle(
                          color: ColorsUtil.title,
                          fontSize: 16.r,
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                      SizedBox(
                        height: 10.r,
                      ),
                      separatorLine(),
                      SizedBox(
                        height: 10.r,
                      ),
                      Row(
                        children: [
                          loadAvater(size: 40.r),
                          SizedBox(
                            width: 10.r,
                          ),
                          Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Text(
                                state.proInstruction.directiveUserName??'',
                                style: TextStyle(
                                  color: ColorsUtil.title,
                                  fontSize: 16.sp,
                                  fontWeight: FontWeight.bold,
                                ),
                              ),
                              SizedBox(height: 10.r,),
                              Text(
                                (state.proInstruction.tagDate??'')+'\t\t'+(state.proInstruction.tagTime??''),
                                style: TextStyle(
                                  color: ColorsUtil.content,
                                  fontSize: 12.r,
                                ),
                              ),
                            ],
                          ),
                        ],
                      ),
                      Container(
                        padding: EdgeInsets.symmetric(vertical: 10.r),
                        child: Html(
                          data: state.proInstruction.directiveContent??'',

                          style: {

                            'code':Style(
                                color: ColorsUtil.blue,
                                fontSize: FontSize.large
                            )
                          },
                        ),
                      ),

                    ],
                  ),
                ),
              )
            ],
          ),
         
          Container(
            margin: EdgeInsets.all(20.r),
            child: Text('批示回复（0）',style: TextStyle(color: Colors.black,fontSize: 16.r,fontWeight: FontWeight.bold),),
          ),
          Center(
            child: EmptyView(title: '当前无回复',),
          )

        ],
      ),
    );
  }
}
